< Prev(J) / Next(K) > / View :

Filename: /text/sbasic/shared/03020302.xhp

(section: loc) (bookmark: bm_id3148663)
Loc function

Loc 関数

Loc Function [Runtime]
Loc 関数 [実行時](hd_id3148663.1)

Returns the current position in an open file.
オープン済みファイルについて、現在のファイルポインタを返します。(par_id3154138.2)

(/section: loc)

Syntax:
構文:(hd_id3156422.3)

Loc(FileNumber)
Loc(FileNumber)(par_id3150768.4)

Return value:
戻り値:(hd_id3150440.5)

Long
ロング整数(par_id3152578.6)

Parameters:
パラメータ:(hd_id3152462.7)

FileNumber: Any numeric expression that contains the file number that is set by the Open statement for the respective file.
FileNumber: 該当ファイルに対し Open ステートメントが割り当てたファイル番号を示す数値表式。(par_id3153363.8)

If the Loc function is used for an open random access file, it returns the number of the last record that was last read or written.
オープンしたランダムアクセスファイルに対して Loc 関数を使用すると、最後に読み取りないし書き込みの行われたレコード番号が返されます。(par_id3154320.9)

For a sequential file, the Loc function returns the position in a file divided by 128. For binary files, the position of the last read or written byte is returned.
順編成ファイルの場合、Loc 関数からは 128 で割ったファイル位置が返されます。バイナリファイルの場合は、最後に読み取りないし書き込みの行われたバイト位置が返されます。(par_id3151115.10)

(embed text/sbasic/shared/00000003.xhp#errorcode : linkinfo)

Error Codes

エラーコード(hd_id3152869.37)

(/embed text/sbasic/shared/00000003.xhp#errorcode)

(embed text/sbasic/shared/00000003.xhp#err5 : linkinfo)

5 Invalid procedure call
5 無効なプロシージャー呼び出しです (par_id3150891.41)

(/embed text/sbasic/shared/00000003.xhp#err5)

(embed text/sbasic/shared/00000003.xhp#err52 : linkinfo)

52 Bad file name or number
52 ファイル名または番号が不正です(par_id3154404.58)

(/embed text/sbasic/shared/00000003.xhp#err52)


< Prev / Next >